#include <iostream>
#include <string>

class animal
{
public:
    std::string mouth;

    void eat();
    void sleep();
    void drool();
};
//继承了animal基类
class pig: public animal
{
public:
    void climb();
    void eat();
};

class turtle:public animal
{
public:
    void swim();
    void eat();
};

void animal::eat()
{
    std::cout<<"animal::I'm eatting!"<<std::endl;
}
void animal::sleep()
{
    std::cout<<"animal::I'm sleeping!"<<std::endl;
}
void animal::drool()
{
    std::cout<<"animal::I'm drooling!"<<std::endl;
}
void pig::climb()
{
    std::cout<<"pig::I'm a pig,i'm climbing!"<<std::endl;
}
void pig::eat()
{
    animal::eat();
    std::cout<<"---->pig is eating fish!!\n";
}
void turtle::swim()
{
    std::cout<<"turtle::I'm a turtle!i'm swiming!"<<std::endl;
}
void turtle::eat()
{
    animal::eat();
    std::cout<<"---->turtle is eating fish!!\n";
}
int main()
{
    pig p;
    turtle t;

    p.eat();
    p.climb();

    t.sleep();
    t.swim();
    t.eat();
    return 0;
}
